package problems;

public class Euler040 extends AbstractEuler {

	@Override
	public Number calculate() {
		StringBuffer concatenation = new StringBuffer();
		for (int i = 0; i <= 1000000; i++) {
			concatenation.append(i);
		}
		
		int product = 1;
		for (int i = 1; i <= 1000000; i *= 10) {
			product *= Integer.valueOf(String.valueOf(concatenation.charAt(i)));
		}
		
		return product;
	}

	@Override
	protected Number getCorrectAnswer() {
		return 210;
	}

}
